<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="EmpenhoCreateDlg" widgetVar="EmpenhoCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.CreateEmpenhoTitle}">
            <h:form id="EmpenhoCreateForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{empenhoController.selected != null}">
                        <p:outputLabel value="#{bundle.CreateEmpenhoLabel_idEmpenho}" for="idEmpenho" />
                        <p:inputText id="idEmpenho" value="#{empenhoController.selected.idEmpenho}" title="#{bundle.CreateEmpenhoTitle_idEmpenho}" required="true" requiredMessage="#{bundle.CreateEmpenhoRequiredMessage_idEmpenho}"/>
                        <p:outputLabel value="#{bundle.CreateEmpenhoLabel_nuEmpenho}" for="nuEmpenho" />
                        <p:inputText id="nuEmpenho" value="#{empenhoController.selected.nuEmpenho}" title="#{bundle.CreateEmpenhoTitle_nuEmpenho}" required="true" requiredMessage="#{bundle.CreateEmpenhoRequiredMessage_nuEmpenho}"/>
                        <p:outputLabel value="#{bundle.CreateEmpenhoLabel_vlEmpenho}" for="vlEmpenho" />
                        <p:inputText id="vlEmpenho" value="#{empenhoController.selected.vlEmpenho}" title="#{bundle.CreateEmpenhoTitle_vlEmpenho}" required="true" requiredMessage="#{bundle.CreateEmpenhoRequiredMessage_vlEmpenho}"/>
                        <p:outputLabel value="#{bundle.CreateEmpenhoLabel_codContrato}" for="codContrato" />
                        <p:selectOneMenu id="codContrato" value="#{empenhoController.selected.codContrato}" required="true" requiredMessage="#{bundle.EditEmpenhoRequiredMessage_codContrato}">
                            <f:selectItems value="#{contratoController.itemsAvailableSelectOne}"
                                           var="codContratoItem"
                                           itemValue="#{codContratoItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{empenhoController.create}" value="#{bundle.Save}" update="display,:EmpenhoListForm:datalist,:growl" oncomplete="handleSubmit(args,'EmpenhoCreateDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="EmpenhoCreateDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
